package vo {
	import org.davekeen.flextrine.orm.PersistentCollection;
	import org.davekeen.flextrine.orm.FlextrineError;
  	import vo.Country;
   	import vo.Mark;
  
	[Bindable]
	public class StudentEntityBase {
		
		public var isUnserialized__:Boolean;
		
		public var isInitialized__:Boolean = true;
		
		public var isCollectionInitializedMap__:Object = new Object();
		
		[Id]
		public var id:String;
		
		public function get name():String { checkIsInitialized("name"); return _name; }
		public function set name(value:String):void { _name = value; }
		private var _name:String;
		
		[Association]
		public function get country():Country { checkIsInitialized("country"); return _country; }
		public function set country(value:Country):void { _country = value; }
		private var _country:Country;
		
		[Association]
		public function get marks():PersistentCollection { checkIsInitialized("marks"); return _marks; }
		public function set marks(value:PersistentCollection):void { _marks = value; }
		private var _marks:PersistentCollection;
		
		public function StudentEntityBase() {
			marks = new PersistentCollection();
		}
		
		public function toString():String {
			return "[Student id=" + id + "]";
		}
		
		private function checkIsInitialized(property:String):void {
			if (!isInitialized__ && isUnserialized__)
				throw new FlextrineError("Attempt to get property '" + property + "' on unitialized Student.  Consider using EntityManager::require or eager loading.", FlextrineError.ACCESSED_UNITIALIZED_ENTITY);
		}
		
	}

}
